<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
	</head>

	<body>

		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">支付</h1>
		</header>
		<div class="mui-content" style="text-align: center;">
			<br />
			<div class="mui-btn mui-btn-primary" id="wx_pay_btn">微信支付</div>
			<div class="mui-btn mui-btn-primary" id="ali_pay_btn">支付宝支付</div>
		</div>
		<script src="../js/mui.min.js"></script>
		<script src="../js/tools/pay.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			document.addEventListener("plusready", function() {
				document.getElementById("wx_pay_btn").addEventListener("tap", function() {
					console.log("wx_pay"); 
					get_pay_channel(function(paylist) {
						// 请求支付操作
						var order_info = {

						}
						get_wx_statement(order_info, function(statement) {
							pay(paylist.wx_pay, statement, function() {
								alert("支付操作成功！");
							})
						})

					})
				})

				document.getElementById("ali_pay_btn").addEventListener("tap", function() {
					console.log("ali_pay");
					get_pay_channel(function(paylist) {
						// 请求支付操作
						var order_info = {

						}
						get_ali_statement(order_info,function(statement) {
							pay(paylist.ali_pay, statement, function() {
								alert("支付操作成功！");
							})
						})

					})
				})

			})

			mui.init()
		</script>
	</body>

</html>